package com.arcpan.Mapper;

import com.arcpan.Entity.Query.FileInfoQuery;
import com.arcpan.Entity.Vo.FileInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FileInfoMapper {

Long selectUseSpace(@Param("userId") String userId);
    Page<FileInfo> selectByQuery(FileInfoQuery fileInfoQuery);

    Long selectCount(FileInfoQuery fileInfoQuery);
    Long updateUserSpace(String userId,Long useSpace,Long totalSpace);

    void insert(FileInfo dfileInfo);

    FileInfo selectByQuery1(FileInfoQuery fileInfoQuery);

//    void updateFileStatuswithOlderStatus(String fileId, String userId,@Param("fileInfo") FileInfo fileInfo, int oldStatus);

@Select("select * from file_info where file_id=#{fileId}")
    FileInfo selectall(String fileId);

    List<FileInfo> getBylist();

    Long updateFileStatuswithOlderStatus(String fileId, String userId,@Param("fileInfo") FileInfo fileInfo, int oldStatus);

    void update(@Param("fileInfo") FileInfo fileInfo,@Param("fileId") String fileId);

    List<FileInfo> selectByQuery2(FileInfoQuery fileInfoQuery);

    void updateFileDel( @Param("fileInfo") FileInfo fileInfo, String userId, List<String> filePidList, List<String> fileIdList, int oldDelFlag);
    void delFileDel( String userId, List<String> filePidList, List<String> fileIdList, int oldDelFlag);
}
